﻿using System;

using System.Threading;

namespace Qplus.Infrastructure
{
    public class SingleExecutor
    {
        private static SingleExecutor instance;

       // private ThreadPool executor;

        public SingleExecutor()
        {
         //   if (executor == null)
                //ThreadPool.SetMaxThreads(1, 1);
                //executor = Executors.newSingleThreadScheduledExecutor();
        }

        public static SingleExecutor getInstance(){
		    if(instance == null){
			    instance = new SingleExecutor();
		    }
		    return instance;
	    }

        public void submit(WaitCallback callable)
        {

            ThreadPool.QueueUserWorkItem(callable);
		    //if(executor == null)
			//    executor = Executors.newSingleThreadScheduledExecutor();
		    //return executor.submit(callable);
	    }

    }
}
